import javaRequest from "../../javaInterface";

export default function searchBook(url, data) {
  let formdata = {};
  for (const key in data) {
    if (data[key] != "") {
      formdata[key] = data[key];
    }
  }
  const type = formdata.type ?? "";
  const name = formdata.name ?? "";
  const press = formdata.press ?? "";
  return javaRequest.request({
    method: "GET",
    url: url + `?type=${type}&name=${name}&press=${press}`,
    headers: {
      "Content-Type": "charset=UTF-8",
    },
  });
}
